package cn.qingyun.gis.modules.enterprise.controller;


import cn.qingyun.gis.common.Result;
import cn.qingyun.gis.modules.enterprise.request.BuildingRequest;
import cn.qingyun.gis.modules.enterprise.service.IBuildingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 五大建筑场景表 前端控制器
 * </p>
 *
 * @author skb
 * @since 2024-03-29
 */
@RestController
@RequestMapping("/building")
public class BuildingController {

    @Autowired
    private IBuildingService buildingService;

    @ApiOperation("获取建筑列表数据")
    @PostMapping("/list")
    public Result<?> getBuildingList(@RequestBody BuildingRequest buildingRequest){
        return Result.okData(buildingService.getBuildingList(buildingRequest));
    }

    @ApiOperation("导出所有建筑概览明细")
    @GetMapping("/export")
    public void exportExcel(HttpServletResponse response) {
        buildingService.exportExcel(response);
    }

}
